import { Component } from 'react';
import RouterView from './router';
import Myheader from './components/myheader';
import NavBar from './components/navBar';
import './App.css'
import WithRouter from './router/WithRouter';
import bus from './utils/bus';
class App extends Component {
    state = {
        title: "首页"
    }
    render() {
        let { title } = this.state
        return (
            <div>
                <Myheader>{title}</Myheader>
                <NavBar></NavBar>
                <RouterView></RouterView>
            </div>
        )
    }
    componentDidMount() {

        bus.on("sendTitle", (title) => {
            console.log(title)
            this.setState({
                title: title
            })
        })
    }
}
export default WithRouter(App);